home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / GXTypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  51.0 KB  |  2,001 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        GXTypes.h
  3.  
  4.      Contains:    QuickDraw GX object and constant definitions
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __GXTYPES__
  19. #define __GXTYPES__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27. #ifndef __FIXMATH__
  28. #include <FixMath.h>
  29. #endif
  30. #ifndef __GXMATH__
  31. #include <GXMath.h>
  32. #endif
  33.  
  34.  
  35.  
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_STRUCT_ALIGN
  49.     #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51.     #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53.     #pragma pack(2)
  54. #endif
  55.  
  56.  
  57.  
  58. typedef struct OpaquegxShape*             gxShape;
  59. typedef struct OpaquegxStyle*             gxStyle;
  60. typedef struct OpaquegxInk*             gxInk;
  61. typedef struct OpaquegxTransform*         gxTransform;
  62. typedef struct OpaquegxTag*             gxTag;
  63. typedef struct OpaquegxColorSet*         gxColorSet;
  64. typedef struct OpaquegxColorProfile*     gxColorProfile;
  65. typedef struct OpaquegxGraphicsClient*     gxGraphicsClient;
  66. typedef struct OpaquegxViewGroup*         gxViewGroup;
  67. typedef struct OpaquegxViewPort*         gxViewPort;
  68. typedef struct OpaquegxViewDevice*         gxViewDevice;
  69.  
  70. typedef long                             gxColorSpace;
  71. /* gxShape enumerations */
  72.  
  73. enum {
  74.     gxEmptyType                    = 1,
  75.     gxPointType                    = 2,
  76.     gxLineType                    = 3,
  77.     gxCurveType                    = 4,
  78.     gxRectangleType                = 5,
  79.     gxPolygonType                = 6,
  80.     gxPathType                    = 7,
  81.     gxBitmapType                = 8,
  82.     gxTextType                    = 9,
  83.     gxGlyphType                    = 10,
  84.     gxLayoutType                = 11,
  85.     gxFullType                    = 12,
  86.     gxPictureType                = 13
  87. };
  88.  
  89. typedef long                             gxShapeType;
  90.  
  91. enum {
  92.     gxNoFill                    = 0,
  93.     gxOpenFrameFill                = 1,
  94.     gxFrameFill                    = gxOpenFrameFill,
  95.     gxClosedFrameFill            = 2,
  96.     gxHollowFill                = gxClosedFrameFill,
  97.     gxEvenOddFill                = 3,
  98.     gxSolidFill                    = gxEvenOddFill,
  99.     gxWindingFill                = 4,
  100.     gxInverseEvenOddFill        = 5,
  101.     gxInverseSolidFill            = gxInverseEvenOddFill,
  102.     gxInverseFill                = gxInverseEvenOddFill,
  103.     gxInverseWindingFill        = 6
  104. };
  105.  
  106. typedef long                             gxShapeFill;
  107.  
  108. enum {
  109.     gxNoAttributes                = 0,
  110.     gxDirectShape                = 0x0001,
  111.     gxRemoteShape                = 0x0002,
  112.     gxCachedShape                = 0x0004,
  113.     gxLockedShape                = 0x0008,
  114.     gxGroupShape                = 0x0010,
  115.     gxMapTransformShape            = 0x0020,
  116.     gxUniqueItemsShape            = 0x0040,
  117.     gxIgnorePlatformShape        = 0x0080,
  118.     gxNoMetricsGridShape        = 0x0100,
  119.     gxDiskShape                    = 0x0200,
  120.     gxMemoryShape                = 0x0400
  121. };
  122.  
  123. typedef long                             gxShapeAttribute;
  124. /* gxShape editing enumerations */
  125.  
  126. enum {
  127.     gxBreakNeitherEdit            = 0,
  128.     gxBreakLeftEdit                = 0x0001,
  129.     gxBreakRightEdit            = 0x0002,
  130.     gxRemoveDuplicatePointsEdit    = 0x0004
  131. };
  132.  
  133. /* if the new first (or last) point exactly matches the point before it in */
  134. /* the same contour, then remove it) */
  135. typedef long                             gxEditShapeFlag;
  136.  
  137. enum {
  138.     gxSelectToEnd                = -1
  139. };
  140.  
  141. #define gxSetToNil    (void *)(-1)
  142. #define gxAnyNumber     1
  143.  
  144. enum {
  145.     gxCounterclockwiseDirection    = 0,
  146.     gxClockwiseDirection        = 1
  147. };
  148.  
  149. typedef long                             gxContourDirection;
  150. /* gxShape structures */
  151. /* The type 'gxPoint' is defined in "GXMath.h" */
  152.  
  153. struct gxLine {
  154.     gxPoint                         first;
  155.     gxPoint                         last;
  156. };
  157. typedef struct gxLine                    gxLine;
  158.  
  159. struct gxCurve {
  160.     gxPoint                         first;
  161.     gxPoint                         control;
  162.     gxPoint                         last;
  163. };
  164. typedef struct gxCurve                    gxCurve;
  165.  
  166. struct gxRectangle {
  167.     Fixed                             left;
  168.     Fixed                             top;
  169.     Fixed                             right;
  170.     Fixed                             bottom;
  171. };
  172. typedef struct gxRectangle                gxRectangle;
  173.  
  174. struct gxPolygon {
  175.     long                             vectors;
  176.     gxPoint                         vector[1];
  177. };
  178. typedef struct gxPolygon                gxPolygon;
  179.  
  180. struct gxPolygons {
  181.     long                             contours;
  182.     gxPolygon                         contour[1];
  183. };
  184. typedef struct gxPolygons                gxPolygons;
  185.  
  186. struct gxPath {
  187.     long                             vectors;
  188.     long                             controlBits[1];
  189.     gxPoint                         vector[1];
  190. };
  191. typedef struct gxPath                    gxPath;
  192.  
  193. struct gxPaths {
  194.     long                             contours;
  195.     gxPath                             contour[1];
  196. };
  197. typedef struct gxPaths                    gxPaths;
  198.  
  199. struct gxBitmap {
  200.     char            *image;        /* pointer to pixels */
  201.     long            width;        /* width in pixels */
  202.     long            height;        /* height in pixels */
  203.     long            rowBytes;    /* width in bytes */
  204.     long            pixelSize;        /* physical bits per pixel */
  205.     gxColorSpace      space;
  206.     gxColorSet        set;
  207.     gxColorProfile    profile;
  208. };
  209. typedef struct gxBitmap gxBitmap;
  210.  
  211. struct gxLongRectangle {
  212.     long                             left;
  213.     long                             top;
  214.     long                             right;
  215.     long                             bottom;
  216. };
  217. typedef struct gxLongRectangle            gxLongRectangle;
  218. /* gxStyle enumerations */
  219.  
  220. enum {
  221.     gxCenterFrameStyle            = 0,
  222.     gxSourceGridStyle            = 0x0001,
  223.     gxDeviceGridStyle            = 0x0002,
  224.     gxInsideFrameStyle            = 0x0004,
  225.     gxOutsideFrameStyle            = 0x0008,
  226.     gxAutoInsetStyle            = 0x0010
  227. };
  228.  
  229.  
  230. typedef long                             gxStyleAttribute;
  231.  
  232. enum {
  233.     gxBendDash                    = 0x0001,
  234.     gxBreakDash                    = 0x0002,
  235.     gxClipDash                    = 0x0004,
  236.     gxLevelDash                    = 0x0008,
  237.     gxAutoAdvanceDash            = 0x0010
  238. };
  239.  
  240. typedef long                             gxDashAttribute;
  241.  
  242. enum {
  243.     gxPortAlignPattern            = 0x0001,
  244.     gxPortMapPattern            = 0x0002
  245. };
  246.  
  247. typedef long                             gxPatternAttribute;
  248.  
  249. enum {
  250.     gxSharpJoin                    = 0x0000,
  251.     gxCurveJoin                    = 0x0001,
  252.     gxLevelJoin                    = 0x0002,
  253.     gxSnapJoin                    = 0x0004
  254. };
  255.  
  256. typedef long                             gxJoinAttribute;
  257.  
  258. enum {
  259.     gxLevelStartCap                = 0x0001,
  260.     gxLevelEndCap                = 0x0002
  261. };
  262.  
  263. typedef long                             gxCapAttribute;
  264.  
  265. enum {
  266.     gxAutoAdvanceText            = 0x0001,
  267.     gxNoContourGridText            = 0x0002,
  268.     gxNoMetricsGridText            = 0x0004,
  269.     gxAnchorPointsText            = 0x0008,
  270.     gxVerticalText                = 0x0010,
  271.     gxNoOpticalScaleText        = 0x0020
  272. };
  273.  
  274. typedef long                             gxTextAttribute;
  275.  
  276. enum {
  277.     gxLeftJustify                = 0,
  278.     gxCenterJustify                = fract1 / 2,
  279.     gxRightJustify                = fract1,
  280.     gxFillJustify                = -1
  281. };
  282.  
  283.  
  284. enum {
  285.     gxUnderlineAdvanceLayer        = 0x0001,                        /* a gxLine is drawn through the advances */
  286.     gxSkipWhiteSpaceLayer        = 0x0002,                        /* except characters describing white space */
  287.     gxUnderlineIntervalLayer    = 0x0004,                        /* (+ gxStringLayer) a gxLine is drawn through the gaps between advances */
  288.     gxUnderlineContinuationLayer = 0x0008,                        /* (+ gxStringLayer) join this underline with another face */
  289.     gxWhiteLayer                = 0x0010,                        /* the layer draws to white instead of black */
  290.     gxClipLayer                    = 0x0020,                        /* the characters define a clip */
  291.     gxStringLayer                = 0x0040                        /* all characters in run are combined */
  292. };
  293.  
  294. typedef long                             gxLayerFlag;
  295. /* gxStyle structures */
  296.  
  297. struct gxFaceLayer {
  298.     gxShapeFill                     outlineFill;                /* outline framed or filled */
  299.     gxLayerFlag                     flags;                        /* various additional effects */
  300.     gxStyle                         outlineStyle;                /* outline */
  301.     gxTransform                     outlineTransform;            /* italic, condense, extend */
  302.     gxPoint                         boldOutset;                    /* bold */
  303. };
  304. typedef struct gxFaceLayer                gxFaceLayer;
  305.  
  306. struct gxTextFace {
  307.     long                             faceLayers;                    /* layer to implement shadow */
  308.     gxMapping                         advanceMapping;                /* algorithmic change to advance width */
  309.     gxFaceLayer                     faceLayer[1];                /* zero or more face layers describing the face */
  310. };
  311. typedef struct gxTextFace                gxTextFace;
  312.  
  313. struct gxJoinRecord {
  314.     gxJoinAttribute                 attributes;
  315.     gxShape                         join;
  316.     Fixed                             miter;
  317. };
  318. typedef struct gxJoinRecord                gxJoinRecord;
  319.  
  320. struct gxDashRecord {
  321.     gxDashAttribute                 attributes;
  322.     gxShape                         dash;                        /* similar to pattern, except rotated to gxLine slope */
  323.     Fixed                             advance;                    /* specifies repeating frequency of dash */
  324.     Fract                             phase;                        /* specifies offset into the gxPath to start dashing */
  325.     Fixed                             scale;                        /* specifies height of dash to be mapped to penWidth */
  326. };
  327. typedef struct gxDashRecord                gxDashRecord;
  328.  
  329. struct gxPatternRecord {
  330.     gxPatternAttribute                 attributes;
  331.     gxShape                         pattern;
  332.     gxPoint                         u;
  333.     gxPoint                         v;
  334. };
  335. typedef struct gxPatternRecord            gxPatternRecord;
  336.  
  337. struct gxCapRecord {
  338.     gxCapAttribute                     attributes;
  339.     gxShape                         startCap;
  340.     gxShape                         endCap;
  341. };
  342. typedef struct gxCapRecord                gxCapRecord;
  343.  
  344. /* gxInk enumerations */
  345.  
  346. enum {
  347.     gxPortAlignDitherInk        = 0x0001,
  348.     gxForceDitherInk            = 0x0002,
  349.     gxSuppressDitherInk            = 0x0004,
  350.     gxSuppressHalftoneInk        = 0x0008
  351. };
  352.  
  353.  
  354. typedef long                             gxInkAttribute;
  355.  
  356. enum {
  357.     gxNoMode                    = 0,
  358.     gxCopyMode                    = 1,
  359.     gxAddMode                    = 2,
  360.     gxBlendMode                    = 3,
  361.     gxMigrateMode                = 4,
  362.     gxMinimumMode                = 5,
  363.     gxMaximumMode                = 6,
  364.     gxHighlightMode                = 7,
  365.     gxAndMode                    = 8,
  366.     gxOrMode                    = 9,
  367.     gxXorMode                    = 10,
  368.     gxRampAndMode                = 11,
  369.     gxRampOrMode                = 12,
  370.     gxRampXorMode                = 13,
  371.     gxOverMode                    = 14,                            /* Alpha channel modes                */
  372.     gxAtopMode                    = 15,                            /* Note: In England = Beta channel modes        */
  373.     gxExcludeMode                = 16,
  374.     gxFadeMode                    = 17
  375. };
  376.  
  377. typedef unsigned char                     gxComponentMode;
  378.  
  379. enum {
  380.     gxRejectSourceTransfer        = 0x0001,                        /* at least one component must be out of range        */
  381.     gxRejectDeviceTransfer        = 0x0002,                        /* at least one component must be out of range        */
  382.     gxSingleComponentTransfer    = 0x0004                        /* duplicate gxTransferComponent[0] for all components in transfer */
  383. };
  384.  
  385. typedef long                             gxTransferFlag;
  386.  
  387. enum {
  388.     gxOverResultComponent        = 0x01,                            /* & result gxColor with 0xFFFF before clamping    */
  389.     gxReverseComponent            = 0x02                            /* reverse source and device before moding        */
  390. };
  391.  
  392. typedef unsigned char                     gxComponentFlag;
  393. /* gxInk structures */
  394.  
  395. struct gxTransferComponent {
  396.     gxComponentMode                 mode;                        /* how the component is operated upon */
  397.     gxComponentFlag                 flags;                        /* flags for each component    */
  398.     gxColorValue                     sourceMinimum;
  399.     gxColorValue                     sourceMaximum;                /* input filter range */
  400.     gxColorValue                     deviceMinimum;
  401.     gxColorValue                     deviceMaximum;                /* output filter range */
  402.     gxColorValue                     clampMinimum;
  403.     gxColorValue                     clampMaximum;                /* output clamping range */
  404.     gxColorValue                     operand;                    /* ratio for blend, step for migrate, gxColor for highlight    */
  405. };
  406. typedef struct gxTransferComponent        gxTransferComponent;
  407.  
  408. struct gxTransferMode {
  409.     gxColorSpace        space;            /* the gxColor-space the transfer mode is to operate in    */
  410.     gxColorSet            set;
  411.     gxColorProfile        profile;
  412.     Fixed                sourceMatrix[5][4];
  413.     Fixed                deviceMatrix[5][4];
  414.     Fixed                resultMatrix[5][4];
  415.     gxTransferFlag        flags;
  416.     gxTransferComponent component[4];  /* how each component is operated upon            */
  417. };
  418. typedef struct gxTransferMode gxTransferMode;
  419. /* gxColor space enumerations */
  420.  
  421. enum {
  422.     gxNoColorPacking            = 0x0000,                        /* 16 bits per channel */
  423.     gxAlphaSpace                = 0x0080,                        /* space includes alpha channel */
  424.     gxWord5ColorPacking            = 0x0500,                        /* 5 bits per channel, right-justified */
  425.     gxLong8ColorPacking            = 0x0800,                        /* 8 bits per channel, right-justified */
  426.     gxLong10ColorPacking        = 0x0A00,                        /* 10 bits per channel, right-justified */
  427.     gxAlphaFirstPacking            = 0x1000                        /* alpha channel is the first field in the packed space */
  428. };
  429.  
  430.  
  431. enum {
  432.     gxNoSpace                    = 0,
  433.     gxRGBSpace                    = 1,
  434.     gxCMYKSpace                    = 2,
  435.     gxHSVSpace                    = 3,
  436.     gxHLSSpace                    = 4,
  437.     gxYXYSpace                    = 5,
  438.     gxXYZSpace                    = 6,
  439.     gxLUVSpace                    = 7,
  440.     gxLABSpace                    = 8,
  441.     gxYIQSpace                    = 9,
  442.     gxNTSCSpace                    = gxYIQSpace,
  443.     gxPALSpace                    = gxYIQSpace,
  444.     gxGraySpace                    = 10,
  445.     gxIndexedSpace                = 11,
  446.     gxRGBASpace                    = gxRGBSpace + gxAlphaSpace,
  447.     gxGrayASpace                = gxGraySpace + gxAlphaSpace,
  448.     gxRGB16Space                = gxWord5ColorPacking + gxRGBSpace,
  449.     gxRGB32Space                = gxLong8ColorPacking + gxRGBSpace,
  450.     gxARGB32Space                = gxLong8ColorPacking + gxAlphaFirstPacking + gxRGBASpace,
  451.     gxCMYK32Space                = gxLong8ColorPacking + gxCMYKSpace,
  452.     gxHSV32Space                = gxLong10ColorPacking + gxHSVSpace,
  453.     gxHLS32Space                = gxLong10ColorPacking + gxHLSSpace,
  454.     gxYXY32Space                = gxLong10ColorPacking + gxYXYSpace,
  455.     gxXYZ32Space                = gxLong10ColorPacking + gxXYZSpace,
  456.     gxLUV32Space                = gxLong10ColorPacking + gxLUVSpace,
  457.     gxLAB32Space                = gxLong10ColorPacking + gxLABSpace,
  458.     gxYIQ32Space                = gxLong10ColorPacking + gxYIQSpace,
  459.     gxNTSC32Space                = gxYIQ32Space,
  460.     gxPAL32Space                = gxYIQ32Space
  461. };
  462.  
  463. /* gxColor space structures */
  464.  
  465. struct gxRGBColor {
  466.     gxColorValue                     red;
  467.     gxColorValue                     green;
  468.     gxColorValue                     blue;
  469. };
  470. typedef struct gxRGBColor                gxRGBColor;
  471.  
  472. struct gxRGBAColor {
  473.     gxColorValue                     red;
  474.     gxColorValue                     green;
  475.     gxColorValue                     blue;
  476.     gxColorValue                     alpha;
  477. };
  478. typedef struct gxRGBAColor                gxRGBAColor;
  479.  
  480. struct gxHSVColor {
  481.     gxColorValue                     hue;
  482.     gxColorValue                     saturation;
  483.     gxColorValue                     value;
  484. };
  485. typedef struct gxHSVColor                gxHSVColor;
  486.  
  487. struct gxHLSColor {
  488.     gxColorValue                     hue;
  489.     gxColorValue                     lightness;
  490.     gxColorValue                     saturation;
  491. };
  492. typedef struct gxHLSColor                gxHLSColor;
  493.  
  494. struct gxCMYKColor {
  495.     gxColorValue                     cyan;
  496.     gxColorValue                     magenta;
  497.     gxColorValue                     yellow;
  498.     gxColorValue                     black;
  499. };
  500. typedef struct gxCMYKColor                gxCMYKColor;
  501.  
  502. struct gxXYZColor {
  503.     gxColorValue                     x;
  504.     gxColorValue                     y;
  505.     gxColorValue                     z;
  506. };
  507. typedef struct gxXYZColor                gxXYZColor;
  508.  
  509. struct gxYXYColor {
  510.     gxColorValue                     capY;
  511.     gxColorValue                     x;
  512.     gxColorValue                     y;
  513. };
  514. typedef struct gxYXYColor                gxYXYColor;
  515.  
  516. struct gxLUVColor {
  517.     gxColorValue                     l;
  518.     gxColorValue                     u;
  519.     gxColorValue                     v;
  520. };
  521. typedef struct gxLUVColor                gxLUVColor;
  522.  
  523. struct gxLABColor {
  524.     gxColorValue                     l;
  525.     gxColorValue                     a;
  526.     gxColorValue                     b;
  527. };
  528. typedef struct gxLABColor                gxLABColor;
  529.  
  530. struct gxYIQColor {
  531.     gxColorValue                     y;
  532.     gxColorValue                     i;
  533.     gxColorValue                     q;
  534. };
  535. typedef struct gxYIQColor                gxYIQColor;
  536.  
  537. struct gxGrayAColor {
  538.     gxColorValue                     gray;
  539.     gxColorValue                     alpha;
  540. };
  541. typedef struct gxGrayAColor                gxGrayAColor;
  542.  
  543. typedef long                             gxColorIndex;
  544. struct gxIndexedColor {
  545.     gxColorIndex      index;
  546.     gxColorSet        set;
  547. };
  548. typedef struct gxIndexedColor gxIndexedColor;
  549.  
  550. struct gxColor {
  551.     gxColorSpace                     space;
  552.     gxColorProfile                     profile;
  553.     union {
  554.         gxCMYKColor                     cmyk;
  555.         gxRGBColor                         rgb;
  556.         gxRGBAColor                     rgba;
  557.         gxHSVColor                         hsv;
  558.         gxHLSColor                         hls;
  559.         gxXYZColor                         xyz;
  560.         gxYXYColor                         yxy;
  561.         gxLUVColor                         luv;
  562.         gxLABColor                         lab;
  563.         gxYIQColor                         yiq;
  564.         gxColorValue                     gray;
  565.         gxGrayAColor                     graya;
  566.         unsigned short                     pixel16;
  567.         unsigned long                     pixel32;
  568.         gxIndexedColor                     indexed;
  569.         gxColorValue                     component[4];
  570.     }                                 element;
  571. };
  572. typedef struct gxColor                    gxColor;
  573.  
  574. /* gxColorSet structures */
  575.  
  576. union gxSetColor {
  577.     gxCMYKColor                     cmyk;
  578.     gxRGBColor                         rgb;
  579.     gxRGBAColor                     rgba;
  580.     gxHSVColor                         hsv;
  581.     gxHLSColor                         hls;
  582.     gxXYZColor                         xyz;
  583.     gxYXYColor                         yxy;
  584.     gxLUVColor                         luv;
  585.     gxLABColor                         lab;
  586.     gxYIQColor                         yiq;
  587.     gxColorValue                     gray;
  588.     gxGrayAColor                     graya;
  589.     unsigned short                     pixel16;
  590.     unsigned long                     pixel32;
  591.     gxColorValue                     component[4];
  592. };
  593. typedef union gxSetColor                gxSetColor;
  594. /* gxTransform enumerations */
  595. /* parts of a gxShape considered in hit testing: */
  596.  
  597. enum {
  598.     gxNoPart                    = 0,                            /* (in order of evaluation) */
  599.     gxBoundsPart                = 0x0001,
  600.     gxGeometryPart                = 0x0002,
  601.     gxPenPart                    = 0x0004,
  602.     gxCornerPointPart            = 0x0008,
  603.     gxControlPointPart            = 0x0010,
  604.     gxEdgePart                    = 0x0020,
  605.     gxJoinPart                    = 0x0040,
  606.     gxStartCapPart                = 0x0080,
  607.     gxEndCapPart                = 0x0100,
  608.     gxDashPart                    = 0x0200,
  609.     gxPatternPart                = 0x0400,
  610.     gxGlyphBoundsPart            = gxJoinPart,
  611.     gxGlyphFirstPart            = gxStartCapPart,
  612.     gxGlyphLastPart                = gxEndCapPart,
  613.     gxSideBearingPart            = gxDashPart,
  614.     gxAnyPart                    = gxBoundsPart | gxGeometryPart | gxPenPart | gxCornerPointPart | gxControlPointPart | gxEdgePart | gxJoinPart | gxStartCapPart | gxEndCapPart | gxDashPart | gxPatternPart
  615. };
  616.  
  617.  
  618. typedef long                             gxShapePart;
  619. /* gxTransform structures */
  620.  
  621. struct gxHitTestInfo {
  622.     gxShapePart                     what;                        /* which part of gxShape */
  623.     long                             index;                        /* control gxPoint index */
  624.     Fixed                             distance;                    /* how far from gxPoint or outside of area click was */
  625.  
  626.                                                                 /* these fields are only set by GXHitTestPicture */
  627.     gxShape                         which;
  628.     gxShape                         containerPicture;            /* picture which contains gxShape hit */
  629.     long                             containerIndex;                /* the index within that picture  */
  630.     long                             totalIndex;                    /* the total index within the root picture */
  631. };
  632. typedef struct gxHitTestInfo            gxHitTestInfo;
  633. /* gxViewPort enumerations */
  634.  
  635. enum {
  636.     gxGrayPort                    = 0x0001,
  637.     gxAlwaysGridPort            = 0x0002,
  638.     gxEnableMatchPort            = 0x0004
  639. };
  640.  
  641.  
  642. typedef long                             gxPortAttribute;
  643. /* gxViewDevice enumerations */
  644.  
  645. enum {
  646.     gxDirectDevice                = 0x01,                            /* for the device gxBitmap baseAddr pointer */
  647.     gxRemoteDevice                = 0x02,
  648.     gxInactiveDevice            = 0x04
  649. };
  650.  
  651. typedef long                             gxDeviceAttribute;
  652.  
  653. enum {
  654.     gxRoundDot                    = 1,
  655.     gxSpiralDot                    = 2,
  656.     gxSquareDot                    = 3,
  657.     gxLineDot                    = 4,
  658.     gxEllipticDot                = 5,
  659.     gxTriangleDot                = 6,
  660.     gxDispersedDot                = 7,
  661.     gxCustomDot                    = 8
  662. };
  663.  
  664. typedef long                             gxDotType;
  665. /* gxViewPort structures */
  666.  
  667. enum {
  668.     gxNoTint                    = 0,
  669.     gxLuminanceTint                = 1,                            /* use the luminance of the gxColor */
  670.     gxAverageTint                = 2,                            /* add all the components and divide by the number of components */
  671.     gxMixtureTint                = 3,                            /* find the closest gxColor on the axis between the foreground and background */
  672.     gxComponent1Tint            = 4,                            /* use the value of the first component of the gxColor */
  673.     gxComponent2Tint            = 5,                            /* ... etc. */
  674.     gxComponent3Tint            = 6,
  675.     gxComponent4Tint            = 7
  676. };
  677.  
  678. typedef long                             gxTintType;
  679.  
  680. struct gxHalftone {
  681.     Fixed                             angle;
  682.     Fixed                             frequency;
  683.     gxDotType                         method;
  684.     gxTintType                         tinting;
  685.     gxColor                         dotColor;
  686.     gxColor                         backgroundColor;
  687.     gxColorSpace                     tintSpace;
  688. };
  689. typedef struct gxHalftone                gxHalftone;
  690.  
  691. struct gxHalftoneMatrix {
  692.     Fixed                             dpiX;                        /* intended resolution */
  693.     Fixed                             dpiY;
  694.     long                             width;                        /* width of matrix (in device pixels) */
  695.     long                             height;                        /* height of matrix (in device pixels) */
  696.     long                             tileShift;                    /* shift amount (in samples) for rectangular tiling */
  697.     unsigned short                     samples[1];                    /* samples from 0..MAX(halftone tintSpace) */
  698. };
  699. typedef struct gxHalftoneMatrix            gxHalftoneMatrix;
  700. /* gxViewGroup enumerations */
  701. #define gxAllViewDevices        ((gxViewGroup) 0)
  702. #define gxScreenViewDevices        ((gxViewGroup) 1)
  703. /* graphics stream constants and structures */
  704.  
  705. enum {
  706.     gxOpenReadSpool                = 1,
  707.     gxOpenWriteSpool            = 2,
  708.     gxReadSpool                    = 3,
  709.     gxWriteSpool                = 4,
  710.     gxCloseSpool                = 5
  711. };
  712.  
  713.  
  714. typedef long                             gxSpoolCommand;
  715. typedef unsigned char                     gxGraphicsOpcode;
  716. typedef struct gxSpoolBlock             gxSpoolBlock;
  717. typedef CALLBACK_API_C( long , gxSpoolProcPtr )(gxSpoolCommand command, gxSpoolBlock *block);
  718. typedef STACK_UPP_TYPE(gxSpoolProcPtr)                             gxSpoolUPP;
  719.  
  720. struct gxSpoolBlock {
  721.     gxSpoolUPP                         spoolProcedure;                /* these fields are read only */
  722.     void *                            buffer;                        /* source/destination pointer to data */
  723.     long                             bufferSize;                    /* how many bytes for the system to read (flatten) / write (unflatten) */
  724.                                                                 /* these fields are written to (but are not read from) */
  725.     long                             count;                        /* how many bytes for the caller to read (unflatten) /write (flatten) */
  726.     long                             operationSize;                /* operation size (including operand byte) */
  727.     long                             operationOffset;            /* the data offset, if any, within the current operation */
  728.     gxGraphicsOpcode                 lastTypeOpcode;                /* type of last created object */
  729.     gxGraphicsOpcode                 currentOperation;            /* operation emitted by flatten, or intrepreted by last unflatten */
  730.     gxGraphicsOpcode                 currentOperand;                /* e.g., gxTransformTypeOpcode, gxInkTagOpcode */
  731.     unsigned char                     compressed;                    /* one of: gxTwoBitCompressionValues */
  732. };
  733.  
  734. enum { uppgxSpoolProcInfo = 0x000003F1 };                         /* 4_bytes Func(4_bytes, 4_bytes) */
  735. #define NewgxSpoolProc(userRoutine)                             (gxSpoolUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppgxSpoolProcInfo, GetCurrentArchitecture())
  736. #define CallgxSpoolProc(userRoutine, command, block)             CALL_TWO_PARAMETER_UPP((userRoutine), uppgxSpoolProcInfo, (command), (block))
  737.  
  738.  
  739. enum {
  740.     gxFontListFlatten            = 0x01,                            /* if set, generate a gxTag containing list of each gxFont referenced */
  741.     gxFontGlyphsFlatten            = 0x02,                            /* if set, generate a gxTag containing the list of glyphs referenced inside the gxFont */
  742.     gxFontVariationsFlatten        = 0x04,                            /* if set, append the gxTag with separate [variation] coordinates */
  743.     gxBitmapAliasFlatten        = 0x08                            /* if set, open bitmap alias files and flatten out their image data */
  744. };
  745.  
  746.  
  747. typedef long                             gxFlattenFlag;
  748. /* gxGraphicsClient constants */
  749. #define gxGraphicsSystemClient        (gxGraphicsClient)(-1)
  750.  
  751. enum {
  752.     gxStaticHeapClient            = 0x0001
  753. };
  754.  
  755. typedef long                             gxClientAttribute;
  756. /* graphics patching constants */
  757.  
  758. enum {
  759.     gxOriginalGraphicsFunction    = -1,
  760.     gxOriginalGraphicsIdentifier = FOUR_CHAR_CODE('grfx')
  761. };
  762.  
  763.  
  764. struct gxBitmapDataSourceAlias {
  765.     unsigned long                     fileOffset;                    /* file offset (in bytes) of top-left pixel */
  766.     unsigned long                     aliasRecordSize;            /* size of alias record below */
  767.     unsigned char                     aliasRecord[1];                /* the actual alias record data */
  768. };
  769. typedef struct gxBitmapDataSourceAlias    gxBitmapDataSourceAlias;
  770.  
  771. enum {
  772.     gxBitmapFileAliasTagType    = FOUR_CHAR_CODE('bfil'),
  773.     gxPICTFileAliasTagType        = FOUR_CHAR_CODE('pict'),
  774.     gxBitmapFileAliasImageValue    = 1L
  775. };
  776.  
  777. typedef struct OpaquegxFont*             gxFont;
  778.  
  779. enum {
  780.     gxNoPlatform                = 0,
  781.     gxNoScript                    = 0,
  782.     gxNoLanguage                = 0,
  783.     gxNoFontName                = 0,
  784.     gxGlyphPlatform                = -1
  785. };
  786.  
  787.  
  788. enum {
  789.     gxUnicodePlatform            = 1,
  790.     gxMacintoshPlatform            = 2,
  791.     gxReservedPlatform            = 3,
  792.     gxMicrosoftPlatform            = 4,
  793.     gxCustomPlatform            = 5
  794. };
  795.  
  796.  
  797. typedef long                             gxFontPlatform;
  798.  
  799. enum {
  800.     gxUnicodeDefaultSemantics    = 1,
  801.     gxUnicodeV1_1Semantics        = 2,
  802.     gxISO10646_1993Semantics    = 3
  803. };
  804.  
  805.  
  806. enum {
  807.     gxRomanScript                = 1,
  808.     gxJapaneseScript            = 2,
  809.     gxTraditionalChineseScript    = 3,
  810.     gxChineseScript                = gxTraditionalChineseScript,
  811.     gxKoreanScript                = 4,
  812.     gxArabicScript                = 5,
  813.     gxHebrewScript                = 6,
  814.     gxGreekScript                = 7,
  815.     gxCyrillicScript            = 8,
  816.     gxRussian                    = gxCyrillicScript,
  817.     gxRSymbolScript                = 9,
  818.     gxDevanagariScript            = 10,
  819.     gxGurmukhiScript            = 11,
  820.     gxGujaratiScript            = 12,
  821.     gxOriyaScript                = 13,
  822.     gxBengaliScript                = 14,
  823.     gxTamilScript                = 15,
  824.     gxTeluguScript                = 16,
  825.     gxKannadaScript                = 17,
  826.     gxMalayalamScript            = 18,
  827.     gxSinhaleseScript            = 19,
  828.     gxBurmeseScript                = 20,
  829.     gxKhmerScript                = 21,
  830.     gxThaiScript                = 22,
  831.     gxLaotianScript                = 23,
  832.     gxGeorgianScript            = 24,
  833.     gxArmenianScript            = 25,
  834.     gxSimpleChineseScript        = 26,
  835.     gxTibetanScript                = 27,
  836.     gxMongolianScript            = 28,
  837.     gxGeezScript                = 29,
  838.     gxEthiopicScript            = gxGeezScript,
  839.     gxAmharicScript                = gxGeezScript,
  840.     gxSlavicScript                = 30,
  841.     gxEastEuropeanRomanScript    = gxSlavicScript,
  842.     gxVietnameseScript            = 31,
  843.     gxExtendedArabicScript        = 32,
  844.     gxSindhiScript                = gxExtendedArabicScript,
  845.     gxUninterpretedScript        = 33
  846. };
  847.  
  848.  
  849. enum {
  850.     gxMicrosoftSymbolScript        = 1,
  851.     gxMicrosoftStandardScript    = 2
  852. };
  853.  
  854.  
  855. enum {
  856.     gxCustom8BitScript            = 1,
  857.     gxCustom816BitScript        = 2,
  858.     gxCustom16BitScript            = 3
  859. };
  860.  
  861. typedef long                             gxFontScript;
  862.  
  863. enum {
  864.     gxEnglishLanguage            = 1,
  865.     gxFrenchLanguage            = 2,
  866.     gxGermanLanguage            = 3,
  867.     gxItalianLanguage            = 4,
  868.     gxDutchLanguage                = 5,
  869.     gxSwedishLanguage            = 6,
  870.     gxSpanishLanguage            = 7,
  871.     gxDanishLanguage            = 8,
  872.     gxPortugueseLanguage        = 9,
  873.     gxNorwegianLanguage            = 10,
  874.     gxHebrewLanguage            = 11,
  875.     gxJapaneseLanguage            = 12,
  876.     gxArabicLanguage            = 13,
  877.     gxFinnishLanguage            = 14,
  878.     gxGreekLanguage                = 15,
  879.     gxIcelandicLanguage            = 16,
  880.     gxMalteseLanguage            = 17,
  881.     gxTurkishLanguage            = 18,
  882.     gxCroatianLanguage            = 19,
  883.     gxTradChineseLanguage        = 20,
  884.     gxUrduLanguage                = 21,
  885.     gxHindiLanguage                = 22,
  886.     gxThaiLanguage                = 23,
  887.     gxKoreanLanguage            = 24,
  888.     gxLithuanianLanguage        = 25,
  889.     gxPolishLanguage            = 26,
  890.     gxHungarianLanguage            = 27,
  891.     gxEstonianLanguage            = 28,
  892.     gxLettishLanguage            = 29,
  893.     gxLatvianLanguage            = gxLettishLanguage,
  894.     gxSaamiskLanguage            = 30,
  895.     gxLappishLanguage            = gxSaamiskLanguage,
  896.     gxFaeroeseLanguage            = 31,
  897.     gxFarsiLanguage                = 32,
  898.     gxPersianLanguage            = gxFarsiLanguage,
  899.     gxRussianLanguage            = 33,
  900.     gxSimpChineseLanguage        = 34,
  901.     gxFlemishLanguage            = 35,
  902.     gxIrishLanguage                = 36,
  903.     gxAlbanianLanguage            = 37,
  904.     gxRomanianLanguage            = 38,
  905.     gxCzechLanguage                = 39,
  906.     gxSlovakLanguage            = 40,
  907.     gxSlovenianLanguage            = 41,
  908.     gxYiddishLanguage            = 42,
  909.     gxSerbianLanguage            = 43,
  910.     gxMacedonianLanguage        = 44,
  911.     gxBulgarianLanguage            = 45,
  912.     gxUkrainianLanguage            = 46,
  913.     gxByelorussianLanguage        = 47,
  914.     gxUzbekLanguage                = 48,
  915.     gxKazakhLanguage            = 49,
  916.     gxAzerbaijaniLanguage        = 50,
  917.     gxAzerbaijanArLanguage        = 51,
  918.     gxArmenianLanguage            = 52,
  919.     gxGeorgianLanguage            = 53,
  920.     gxMoldavianLanguage            = 54,
  921.     gxKirghizLanguage            = 55,
  922.     gxTajikiLanguage            = 56,
  923.     gxTurkmenLanguage            = 57,
  924.     gxMongolianLanguage            = 58,
  925.     gxMongolianCyrLanguage        = 59,
  926.     gxPashtoLanguage            = 60,
  927.     gxKurdishLanguage            = 61,
  928.     gxKashmiriLanguage            = 62,
  929.     gxSindhiLanguage            = 63,
  930.     gxTibetanLanguage            = 64,
  931.     gxNepaliLanguage            = 65,
  932.     gxSanskritLanguage            = 66,
  933.     gxMarathiLanguage            = 67,
  934.     gxBengaliLanguage            = 68,
  935.     gxAssameseLanguage            = 69,
  936.     gxGujaratiLanguage            = 70,
  937.     gxPunjabiLanguage            = 71,
  938.     gxOriyaLanguage                = 72,
  939.     gxMalayalamLanguage            = 73,
  940.     gxKannadaLanguage            = 74,
  941.     gxTamilLanguage                = 75,
  942.     gxTeluguLanguage            = 76,
  943.     gxSinhaleseLanguage            = 77,
  944.     gxBurmeseLanguage            = 78,
  945.     gxKhmerLanguage                = 79,
  946.     gxLaoLanguage                = 80,
  947.     gxVietnameseLanguage        = 81,
  948.     gxIndonesianLanguage        = 82,
  949.     gxTagalogLanguage            = 83,
  950.     gxMalayRomanLanguage        = 84,
  951.     gxMalayArabicLanguage        = 85,
  952.     gxAmharicLanguage            = 86,
  953.     gxTigrinyaLanguage            = 87,
  954.     gxGallaLanguage                = 88,
  955.     gxOromoLanguage                = gxGallaLanguage,
  956.     gxSomaliLanguage            = 89,
  957.     gxSwahiliLanguage            = 90,
  958.     gxRuandaLanguage            = 91,
  959.     gxRundiLanguage                = 92,
  960.     gxChewaLanguage                = 93,
  961.     gxMalagasyLanguage            = 94,
  962.     gxEsperantoLanguage            = 95,
  963.     gxWelshLanguage                = 129,
  964.     gxBasqueLanguage            = 130,
  965.     gxCatalanLanguage            = 131,
  966.     gxLatinLanguage                = 132,
  967.     gxQuechuaLanguage            = 133,
  968.     gxGuaraniLanguage            = 134,
  969.     gxAymaraLanguage            = 135,
  970.     gxTatarLanguage                = 136,
  971.     gxUighurLanguage            = 137,
  972.     gxDzongkhaLanguage            = 138,
  973.     gxJavaneseRomLanguage        = 139,
  974.     gxSundaneseRomLanguage        = 140
  975. };
  976.  
  977. typedef long                             gxFontLanguage;
  978.  
  979. enum {
  980.     gxCopyrightFontName            = 1,
  981.     gxFamilyFontName            = 2,
  982.     gxStyleFontName                = 3,
  983.     gxUniqueFontName            = 4,
  984.     gxFullFontName                = 5,
  985.     gxVersionFontName            = 6,
  986.     gxPostscriptFontName        = 7,
  987.     gxTrademarkFontName            = 8,
  988.     gxManufacturerFontName        = 9,
  989.     gxLastReservedFontName        = 256
  990. };
  991.  
  992. typedef long                             gxFontName;
  993. typedef long                             gxFontTableTag;
  994. typedef long                             gxFontVariationTag;
  995. typedef long                             gxFontFormatTag;
  996. typedef long                             gxFontStorageTag;
  997. typedef gxFontVariationTag                 gxFontDescriptorTag;
  998.  
  999. struct gxFontVariation {
  1000.     gxFontVariationTag                 name;
  1001.     Fixed                             value;
  1002. };
  1003. typedef struct gxFontVariation            gxFontVariation;
  1004.  
  1005. typedef gxFontVariation                 gxFontDescriptor;
  1006.  
  1007. struct gxFontFeatureSetting {
  1008.     unsigned short                     setting;
  1009.     unsigned short                     nameID;
  1010. };
  1011. typedef struct gxFontFeatureSetting        gxFontFeatureSetting;
  1012.  
  1013. enum {
  1014.     gxSystemFontAttribute        = 0x0001,
  1015.     gxReadOnlyFontAttribute        = 0x0002
  1016. };
  1017.  
  1018.  
  1019. typedef long                             gxFontAttribute;
  1020.  
  1021. enum {
  1022.     gxMutuallyExclusiveFeature    = 0x00008000
  1023. };
  1024.  
  1025. typedef long                             gxFontFeatureFlag;
  1026. typedef long                             gxFontFeature;
  1027.  
  1028. enum {
  1029.     gxResourceFontStorage        = FOUR_CHAR_CODE('rsrc'),
  1030.     gxHandleFontStorage            = FOUR_CHAR_CODE('hndl'),
  1031.     gxFileFontStorage            = FOUR_CHAR_CODE('bass'),
  1032.     gxNfntFontStorage            = FOUR_CHAR_CODE('nfnt')
  1033. };
  1034.  
  1035. typedef void *                            gxFontStorageReference;
  1036. typedef unsigned short                     gxGlyphcode;
  1037. /* single glyph in a font */
  1038. /* byte offset within backing store */
  1039. typedef long                             gxByteOffset;
  1040. /* The actual constants for feature types and selectors have been moved to a library. */
  1041. typedef unsigned short                     gxRunFeatureType;
  1042. typedef unsigned short                     gxRunFeatureSelector;
  1043. /* If tracking is not desired, specify the following value in the track field in the
  1044.         gxRunControls record (note that a track of 0 does *not* mean to turn tracking off;
  1045.         rather, it means to use normal tracking). */
  1046.  
  1047. enum {
  1048.     gxNoTracking                = gxNegativeInfinity
  1049. };
  1050.  
  1051. /* The special "gxNoStake" value is returned by the GXGetLayoutBreakOffset call to
  1052.         indicate the absence of a character offset that is stable with respect to
  1053.         metamorphosis and contextual kerning. */
  1054.  
  1055. enum {
  1056.     gxNoStake                    = -1
  1057. };
  1058.  
  1059. /* A glyph's behavior with respect to other glyphs on its line is defined in part by its
  1060.         gxBaselineType. These types allow correct alignment of the baselines of all glyphs on
  1061.         the line. */
  1062.  
  1063. enum {
  1064.     gxRomanBaseline                = 0,
  1065.     gxIdeographicCenterBaseline    = 1,
  1066.     gxIdeographicLowBaseline    = 2,
  1067.     gxHangingBaseline            = 3,
  1068.     gxMathBaseline                = 4,
  1069.     gxLastBaseline                = 31,
  1070.     gxNumberOfBaselineTypes        = gxLastBaseline + 1,
  1071.     gxNoOverrideBaseline        = 255
  1072. };
  1073.  
  1074. typedef unsigned long                     gxBaselineType;
  1075. typedef Fixed                             gxBaselineDeltas[32];
  1076. /* gxJustificationPriority defines the point during the justification process at which a
  1077.     glyph will begin to receive deltas before and after itself. */
  1078.  
  1079. enum {
  1080.     gxKashidaPriority            = 0,
  1081.     gxWhiteSpacePriority        = 1,
  1082.     gxInterCharPriority            = 2,
  1083.     gxNullJustificationPriority    = 3,
  1084.     gxNumberOfJustificationPriorities = 4
  1085. };
  1086.  
  1087. typedef unsigned char                     gxJustificationPriority;
  1088. /* gxJustificationFlags are used to control which fields of a gxWidthDeltaRecord are to
  1089.         be overridden and which are not if a gxPriorityJustificationOverride or
  1090.         gxGlyphJustificationOverride (qq.v.) is specified. */
  1091.  
  1092. enum {
  1093.     gxOverridePriority            = 0x8000,                        /* use priority value from override */
  1094.     gxOverrideLimits            = 0x4000,                        /* use limits values from override */
  1095.     gxOverrideUnlimited            = 0x2000,                        /* use unlimited flag from override */
  1096.     gxUnlimitedGapAbsorption    = 0x1000,                        /* glyph can take unlimited gap */
  1097.     gxJustificationPriorityMask    = 0x000F,                        /* justification priority */
  1098.     gxAllJustificationFlags        = (gxOverridePriority | gxOverrideLimits | gxOverrideUnlimited | gxUnlimitedGapAbsorption | gxJustificationPriorityMask)
  1099. };
  1100.  
  1101. typedef unsigned short                     gxJustificationFlags;
  1102. /* The directional behavior of a glyph can be overridden using a gxDirectionOverride. */
  1103.  
  1104. enum {
  1105.     gxNoDirectionOverride        = 0,
  1106.     gxImposeLeftToRight            = 1,
  1107.     gxImposeRightToLeft            = 2,
  1108.     gxImposeArabic                = 3
  1109. };
  1110.  
  1111. typedef unsigned short                     gxDirectionOverride;
  1112. /* gxRunControlFlags describe the nonparametric layout options contained in a gxStyle. */
  1113.  
  1114. enum {
  1115.     gxNoCaretAngle                = 0x40000000,
  1116.     gxImposeWidth                = 0x20000000,
  1117.     gxNoCrossKerning            = 0x10000000,
  1118.     gxNoOpticalAlignment        = 0x08000000,
  1119.     gxForceHanging                = 0x04000000,
  1120.     gxNoSpecialJustification    = 0x02000000,
  1121.     gxDirectionOverrideMask        = 0x00000003,
  1122.     gxNoLigatureSplits            = (long)0x80000000
  1123. };
  1124.  
  1125.  
  1126. enum {
  1127.     gxAllRunControlFlags        = (gxNoLigatureSplits | gxNoCaretAngle | gxImposeWidth | gxNoCrossKerning | gxNoOpticalAlignment | gxForceHanging | gxNoSpecialJustification | gxDirectionOverrideMask)
  1128. };
  1129.  
  1130. typedef unsigned long                     gxRunControlFlags;
  1131. /* gxHighlightType is used to distinguish various highlighting methods, both in terms of
  1132.         character offset based vs. visual based, and in terms of angled sides vs. non-angled
  1133.         sides. */
  1134.  
  1135. enum {
  1136.     gxHighlightStraight            = 0,                            /* straight-edged simple highlighting */
  1137.     gxHighlightAverageAngle        = 1                                /* takes average of two edge angles */
  1138. };
  1139.  
  1140. typedef unsigned long                     gxHighlightType;
  1141. /* gxCaretType is used to control whether the caret that is returned from GXGetLayoutCaret
  1142.         is a split caret or a (keyboard-syncronized) single caret. */
  1143.  
  1144. enum {
  1145.     gxSplitCaretType            = 0,                            /* returns Mac-style split caret (default) */
  1146.     gxLeftRightKeyboardCaret    = 1,                            /* single caret in left-right position */
  1147.     gxRightLeftKeyboardCaret    = 2                                /* single caret in right-left position */
  1148. };
  1149.  
  1150. typedef unsigned long                     gxCaretType;
  1151. /* gxLayoutOffsetState describes the characteristics of a given gxByteOffset in some
  1152.         layout. It is returned by the GXGetOffsetGlyphs call. Note that the
  1153.         gxOffsetInsideLigature value is returned in addition to the 8/16 (or invalid)
  1154.         indication. */
  1155.  
  1156. enum {
  1157.     gxOffset8_8                    = 0,
  1158.     gxOffset8_16                = 1,
  1159.     gxOffset16_8                = 2,
  1160.     gxOffset16_16                = 3,
  1161.     gxOffsetInvalid                = 4
  1162. };
  1163.  
  1164.  
  1165. enum {
  1166.     gxOffsetInsideLigature        = 0x8000
  1167. };
  1168.  
  1169. typedef unsigned short                     gxLayoutOffsetState;
  1170. /* gxLayoutOptionsFlags are single-bit flags contained in a gxLayoutOptions record. We
  1171.     also define here some utility constants that are useful in setting various fields in
  1172.     the gxLayoutOptions record. */
  1173.  
  1174. enum {
  1175.     gxNoLayoutOptions            = 0,
  1176.     gxLineIsDisplayOnly            = 0x00000001,
  1177.     gxKeepSpacesInMargin        = 0x00000002,
  1178.     gxLimitReorderingToTwoLevels = 0x00000004,
  1179.     gxLineLeftEdgeNotAtMargin    = 0x00000008,
  1180.     gxLineRightEdgeNotAtMargin    = 0x00000010,
  1181.     gxAllLayoutOptionsFlags        = gxLineIsDisplayOnly | gxKeepSpacesInMargin | gxLimitReorderingToTwoLevels | gxLineLeftEdgeNotAtMargin | gxLineRightEdgeNotAtMargin,
  1182.     gxMaxRunLevel                = 15,
  1183.     gxFlushLeft                    = 0,
  1184.     gxFlushCenter                = fract1 / 2,
  1185.     gxFlushRight                = fract1,
  1186.     gxNoJustification            = 0,
  1187.     gxFullJustification            = fract1
  1188. };
  1189.  
  1190. typedef unsigned long                     gxLayoutOptionsFlags;
  1191. /* A gxRunFeature describes a feature and a level for that feature. */
  1192.  
  1193. struct gxRunFeature {
  1194.     gxRunFeatureType                 featureType;
  1195.     gxRunFeatureSelector             featureSelector;
  1196. };
  1197. typedef struct gxRunFeature                gxRunFeature;
  1198. /* A gxWidthDeltaRecord contains all of the information needed to describe the behavior of one
  1199.         class of glyphs during the justification process. */
  1200.  
  1201. struct gxWidthDeltaRecord {
  1202.     Fixed                             beforeGrowLimit;            /* ems AW can grow by at most on LT */
  1203.     Fixed                             beforeShrinkLimit;            /* ems AW can shrink by at most on LT */
  1204.     Fixed                             afterGrowLimit;                /* ems AW can grow by at most on RB */
  1205.     Fixed                             afterShrinkLimit;            /* ems AW can shrink by at most on RB */
  1206.     gxJustificationFlags             growFlags;                    /* flags controlling grow case */
  1207.     gxJustificationFlags             shrinkFlags;                /* flags controlling shrink case */
  1208. };
  1209. typedef struct gxWidthDeltaRecord        gxWidthDeltaRecord;
  1210. /* A gxPriorityJustificationOverride contains an array of WidthDeltaRecords, one for each
  1211.         gxJustificationPriority. */
  1212.  
  1213. struct gxPriorityJustificationOverride {
  1214.     gxWidthDeltaRecord                 deltas[4];                    /* overrides for each of the priorities */
  1215. };
  1216. typedef struct gxPriorityJustificationOverride gxPriorityJustificationOverride;
  1217. /* A gxGlyphJustificationOverride contains a gxWidthDeltaRecord that is to be used for a
  1218.         specific glyph in a specific run (this limitation is because glyphcodes vary by font). */
  1219.  
  1220. struct gxGlyphJustificationOverride {
  1221.     gxGlyphcode                     glyph;
  1222.     gxWidthDeltaRecord                 override;
  1223. };
  1224. typedef struct gxGlyphJustificationOverride gxGlyphJustificationOverride;
  1225.  
  1226. /* gxRunControls contains flags, shifts, imposed widths and overrides for a run. */
  1227. /* NOTE: a value of "gxNoTracking" (see above) in track disables tracking */
  1228.  
  1229. struct gxRunControls {
  1230.     gxRunControlFlags                 flags;
  1231.     Fixed                             beforeWithStreamShift;
  1232.     Fixed                             afterWithStreamShift;
  1233.     Fixed                             crossStreamShift;
  1234.     Fixed                             imposedWidth;
  1235.     Fixed                             track;
  1236.     Fract                             hangingInhibitFactor;
  1237.     Fract                             kerningInhibitFactor;
  1238.     Fixed                             decompositionAdjustmentFactor;
  1239.     gxBaselineType                     baselineType;
  1240. };
  1241. typedef struct gxRunControls            gxRunControls;
  1242. /* A gxGlyphSubstitution describes one client-provided substitution that occurs after all
  1243.         other automatic glyph changes have happened. */
  1244.  
  1245. struct gxGlyphSubstitution {
  1246.     gxGlyphcode                     originalGlyph;                /* Whenever you see this glyph... */
  1247.     gxGlyphcode                     substituteGlyph;            /* ...change it to this one. */
  1248. };
  1249. typedef struct gxGlyphSubstitution        gxGlyphSubstitution;
  1250. /* gxKerningAdjustmentFactors specify an adjustment to automatic kerning. The adjustment
  1251.         is ax + b where x is the automatic kerning value, a is scaleFactor, and b is
  1252.         adjustmentPointSizeFactor times the run's point size. */
  1253.  
  1254. struct gxKerningAdjustmentFactors {
  1255.     Fract                             scaleFactor;
  1256.     Fixed                             adjustmentPointSizeFactor;
  1257. };
  1258. typedef struct gxKerningAdjustmentFactors gxKerningAdjustmentFactors;
  1259. /* A gxKerningAdjustment identifies with- and cross-stream kerning adjustments
  1260.         for specific glyph pairs. */
  1261.  
  1262. struct gxKerningAdjustment {
  1263.     gxGlyphcode                     firstGlyph;
  1264.     gxGlyphcode                     secondGlyph;
  1265.     gxKerningAdjustmentFactors         withStreamFactors;
  1266.     gxKerningAdjustmentFactors         crossStreamFactors;
  1267. };
  1268. typedef struct gxKerningAdjustment        gxKerningAdjustment;
  1269. /* A value of gxResetCrossStreamFactor in crossStreamFactors.adjustmentPointSizeFactor
  1270.         will reset the cross-stream kerning to the baseline. */
  1271.  
  1272. enum {
  1273.     gxResetCrossStreamFactor    = gxNegativeInfinity
  1274. };
  1275.  
  1276. /* gxLayoutHitInfo contains the output from the GXHitTestLayout call. */
  1277.  
  1278. struct gxLayoutHitInfo {
  1279.     Fixed                             firstPartialDist;
  1280.     Fixed                             lastPartialDist;
  1281.     gxByteOffset                     hitSideOffset;
  1282.     gxByteOffset                     nonHitSideOffset;
  1283.     Boolean                         leadingEdge;
  1284.     Boolean                         inLoose;
  1285. };
  1286. typedef struct gxLayoutHitInfo            gxLayoutHitInfo;
  1287. /* A gxLineBaselineRecord contains the deltas from 0 to all the different baselines for
  1288.         the layout. It can be filled via a call to GetBaselineDeltas (q.v.). */
  1289.  
  1290. struct gxLineBaselineRecord {
  1291.     gxBaselineDeltas                 deltas;
  1292. };
  1293. typedef struct gxLineBaselineRecord        gxLineBaselineRecord;
  1294. /* The gxLayoutOptions type contains information about the layout characteristics of the
  1295.         whole line. */
  1296.  
  1297. struct gxLayoutOptions {
  1298.     Fixed                             width;
  1299.     Fract                             flush;
  1300.     Fract                             just;
  1301.     gxLayoutOptionsFlags             flags;
  1302.     gxLineBaselineRecord *            baselineRec;
  1303. };
  1304. typedef struct gxLayoutOptions            gxLayoutOptions;
  1305.  
  1306. enum {
  1307.     gxNewObjectOpcode            = 0x00,                            /* create new object */
  1308.     gxSetDataOpcode                = 0x40,                            /* add reference to current object */
  1309.     gxSetDefaultOpcode            = 0x80,                            /* replace current default with this object */
  1310.     gxReservedOpcode            = 0xC0,                            /* (may be used in future expansion) */
  1311.     gxNextOpcode                = 0xFF                            /* used by currentOperand field to say opcode is coming */
  1312. };
  1313.  
  1314. /* new object types (new object opcode) */
  1315.  
  1316. enum {
  1317.     gxHeaderTypeOpcode            = 0x00,                            /* byte following new object uses bottom 6 bits for type */
  1318.                                                                 /* gxShape types use values 1 (gxEmptyType) through 13 (gxPictureType) */
  1319.     gxStyleTypeOpcode            = 0x28,
  1320.     gxInkTypeOpcode                = 0x29,
  1321.     gxTransformTypeOpcode        = 0x2A,
  1322.     gxColorProfileTypeOpcode    = 0x2B,
  1323.     gxColorSetTypeOpcode        = 0x2C,
  1324.     gxTagTypeOpcode                = 0x2D,
  1325.     gxBitImageOpcode            = 0x2E,
  1326.     gxFontNameTypeOpcode        = 0x2F,
  1327.     gxTrailerTypeOpcode            = 0x3F
  1328. };
  1329.  
  1330. /* fields of objects (set data opcodes) */
  1331.  
  1332. enum {
  1333.     gxShapeAttributesOpcode        = 0,
  1334.     gxShapeTagOpcode            = 1,
  1335.     gxShapeFillOpcode            = 2
  1336. };
  1337.  
  1338.  
  1339. enum {
  1340.     gxOmitPathPositionXMask        = 0xC0,
  1341.     gxOmitPathPositionYMask        = 0x30,
  1342.     gxOmitPathDeltaXMask        = 0x0C,
  1343.     gxOmitPathDeltaYMask        = 0x03
  1344. };
  1345.  
  1346.  
  1347. enum {
  1348.     gxOmitPathPositionXShift    = 6,
  1349.     gxOmitPathPositionYShift    = 4,
  1350.     gxOmitPathDeltaXShift        = 2,
  1351.     gxOmitPathDeltaYShift        = 0
  1352. };
  1353.  
  1354.  
  1355. enum {
  1356.     gxOmitBitmapImageMask        = 0xC0,
  1357.     gxOmitBitmapWidthMask        = 0x30,
  1358.     gxOmitBitmapHeightMask        = 0x0C,
  1359.     gxOmitBitmapRowBytesMask    = 0x03
  1360. };
  1361.  
  1362.  
  1363. enum {
  1364.     gxOmitBitmapImageShift        = 6,
  1365.     gxOmitBitmapWidthShift        = 4,
  1366.     gxOmitBitmapHeightShift        = 2,
  1367.     gxOmitBitmapRowBytesShift    = 0
  1368. };
  1369.  
  1370.  
  1371. enum {
  1372.     gxOmitBitmapPixelSizeMask    = 0xC0,
  1373.     gxOmitBitmapSpaceMask        = 0x30,
  1374.     gxOmitBitmapSetMask            = 0x0C,
  1375.     gxOmitBitmapProfileMask        = 0x03
  1376. };
  1377.  
  1378.  
  1379. enum {
  1380.     gxOmitBitmapPixelSizeShift    = 6,
  1381.     gxOmitBitmapSpaceShift        = 4,
  1382.     gxOmitBitmapSetShift        = 2,
  1383.     gxOmitBitmapProfileShift    = 0
  1384. };
  1385.  
  1386.  
  1387. enum {
  1388.     gxOmitBitmapPositionXMask    = 0xC0,
  1389.     gxOmitBitmapPositionYMask    = 0x30
  1390. };
  1391.  
  1392.  
  1393. enum {
  1394.     gxOmitBitmapPositionXShift    = 6,
  1395.     gxOmitBitmapPositionYShift    = 4
  1396. };
  1397.  
  1398.  
  1399. enum {
  1400.     gxOmitBitImageRowBytesMask    = 0xC0,
  1401.     gxOmitBitImageHeightMask    = 0x30,
  1402.     gxOmitBitImageDataMask        = 0x08
  1403. };
  1404.  
  1405.  
  1406. enum {
  1407.     gxOmitBitImageRowBytesShift    = 6,
  1408.     gxOmitBitImageHeightShift    = 4,
  1409.     gxOmitBitImageDataShift        = 3
  1410. };
  1411.  
  1412.  
  1413. enum {
  1414.     gxCopyBitImageBytesOpcode    = 0x00,
  1415.     gxRepeatBitImageBytesOpcode    = 0x40,
  1416.     gxLookupBitImageBytesOpcode    = 0x80,
  1417.     gxRepeatBitImageScanOpcode    = 0xC0
  1418. };
  1419.  
  1420.  
  1421. enum {
  1422.     gxOmitTextCharactersMask    = 0xC0,
  1423.     gxOmitTextPositionXMask        = 0x30,
  1424.     gxOmitTextPositionYMask        = 0x0C,
  1425.     gxOmitTextDataMask            = 0x02
  1426. };
  1427.  
  1428.  
  1429. enum {
  1430.     gxOmitTextCharactersShift    = 6,
  1431.     gxOmitTextPositionXShift    = 4,
  1432.     gxOmitTextPositionYShift    = 2,
  1433.     gxOmitTextDataShift            = 1
  1434. };
  1435.  
  1436.  
  1437. enum {
  1438.     gxOmitGlyphCharactersMask    = 0xC0,
  1439.     gxOmitGlyphLengthMask        = 0x30,
  1440.     gxOmitGlyphRunNumberMask    = 0x0C,
  1441.     gxOmitGlyphOnePositionMask    = 0x02,
  1442.     gxOmitGlyphDataMask            = 0x01
  1443. };
  1444.  
  1445.  
  1446. enum {
  1447.     gxOmitGlyphCharactersShift    = 6,
  1448.     gxOmitGlyphLengthShift        = 4,
  1449.     gxOmitGlyphRunNumberShift    = 2,
  1450.     gxOmitGlyphOnePositionShift    = 1,
  1451.     gxOmitGlyphDataShift        = 0
  1452. };
  1453.  
  1454.  
  1455. enum {
  1456.     gxOmitGlyphPositionsMask    = 0xC0,
  1457.     gxOmitGlyphAdvancesMask        = 0x20,
  1458.     gxOmitGlyphTangentsMask        = 0x18,
  1459.     gxOmitGlyphRunsMask            = 0x04,
  1460.     gxOmitGlyphStylesMask        = 0x03
  1461. };
  1462.  
  1463.  
  1464. enum {
  1465.     gxOmitGlyphPositionsShift    = 6,
  1466.     gxOmitGlyphAdvancesShift    = 5,
  1467.     gxOmitGlyphTangentsShift    = 3,
  1468.     gxOmitGlyphRunsShift        = 2,
  1469.     gxOmitGlyphStylesShift        = 0
  1470. };
  1471.  
  1472.  
  1473. enum {
  1474.     gxOmitLayoutLengthMask        = 0xC0,
  1475.     gxOmitLayoutPositionXMask    = 0x30,
  1476.     gxOmitLayoutPositionYMask    = 0x0C,
  1477.     gxOmitLayoutDataMask        = 0x02
  1478. };
  1479.  
  1480.  
  1481. enum {
  1482.     gxOmitLayoutLengthShift        = 6,
  1483.     gxOmitLayoutPositionXShift    = 4,
  1484.     gxOmitLayoutPositionYShift    = 2,
  1485.     gxOmitLayoutDataShift        = 1
  1486. };
  1487.  
  1488.  
  1489. enum {
  1490.     gxOmitLayoutWidthMask        = 0xC0,
  1491.     gxOmitLayoutFlushMask        = 0x30,
  1492.     gxOmitLayoutJustMask        = 0x0C,
  1493.     gxOmitLayoutOptionsMask        = 0x03
  1494. };
  1495.  
  1496.  
  1497. enum {
  1498.     gxOmitLayoutWidthShift        = 6,
  1499.     gxOmitLayoutFlushShift        = 4,
  1500.     gxOmitLayoutJustShift        = 2,
  1501.     gxOmitLayoutOptionsShift    = 0
  1502. };
  1503.  
  1504.  
  1505. enum {
  1506.     gxOmitLayoutStyleRunNumberMask = 0xC0,
  1507.     gxOmitLayoutLevelRunNumberMask = 0x30,
  1508.     gxOmitLayoutHasBaselineMask    = 0x08,
  1509.     gxOmitLayoutStyleRunsMask    = 0x04,
  1510.     gxOmitLayoutStylesMask        = 0x03
  1511. };
  1512.  
  1513.  
  1514. enum {
  1515.     gxOmitLayoutStyleRunNumberShift = 6,
  1516.     gxOmitLayoutLevelRunNumberShift = 4,
  1517.     gxOmitLayoutHasBaselineShift = 3,
  1518.     gxOmitLayoutStyleRunsShift    = 2,
  1519.     gxOmitLayoutStylesShift        = 0
  1520. };
  1521.  
  1522.  
  1523. enum {
  1524.     gxOmitLayoutLevelRunsMask    = 0x80,
  1525.     gxOmitLayoutLevelsMask        = 0x40
  1526. };
  1527.  
  1528.  
  1529. enum {
  1530.     gxOmitLayoutLevelRunsShift    = 7,
  1531.     gxOmitLayoutLevelsShift        = 6
  1532. };
  1533.  
  1534.  
  1535. enum {
  1536.     gxInkAttributesOpcode        = 0,
  1537.     gxInkTagOpcode                = 1,
  1538.     gxInkColorOpcode            = 2,
  1539.     gxInkTransferModeOpcode        = 3
  1540. };
  1541.  
  1542.  
  1543. enum {
  1544.     gxOmitColorsSpaceMask        = 0xC0,
  1545.     gxOmitColorsProfileMask        = 0x30,
  1546.     gxOmitColorsComponentsMask    = 0x0F,
  1547.     gxOmitColorsIndexMask        = 0x0C,
  1548.     gxOmitColorsIndexSetMask    = 0x03
  1549. };
  1550.  
  1551.  
  1552. enum {
  1553.     gxOmitColorsSpaceShift        = 6,
  1554.     gxOmitColorsProfileShift    = 4,
  1555.     gxOmitColorsComponentsShift    = 0,
  1556.     gxOmitColorsIndexShift        = 2,
  1557.     gxOmitColorsIndexSetShift    = 0
  1558. };
  1559.  
  1560.  
  1561. enum {
  1562.     gxOmitTransferSpaceMask        = 0xC0,
  1563.     gxOmitTransferSetMask        = 0x30,
  1564.     gxOmitTransferProfileMask    = 0x0C
  1565. };
  1566.  
  1567.  
  1568. enum {
  1569.     gxOmitTransferSpaceShift    = 6,
  1570.     gxOmitTransferSetShift        = 4,
  1571.     gxOmitTransferProfileShift    = 2
  1572. };
  1573.  
  1574.  
  1575. enum {
  1576.     gxOmitTransferSourceMatrixMask = 0xC0,
  1577.     gxOmitTransferDeviceMatrixMask = 0x30,
  1578.     gxOmitTransferResultMatrixMask = 0x0C,
  1579.     gxOmitTransferFlagsMask        = 0x03
  1580. };
  1581.  
  1582.  
  1583. enum {
  1584.     gxOmitTransferSourceMatrixShift = 6,
  1585.     gxOmitTransferDeviceMatrixShift = 4,
  1586.     gxOmitTransferResultMatrixShift = 2,
  1587.     gxOmitTransferFlagsShift    = 0
  1588. };
  1589.  
  1590.  
  1591. enum {
  1592.     gxOmitTransferComponentModeMask = 0x80,
  1593.     gxOmitTransferComponentFlagsMask = 0x40,
  1594.     gxOmitTransferComponentSourceMinimumMask = 0x30,
  1595.     gxOmitTransferComponentSourceMaximumMask = 0x0C,
  1596.     gxOmitTransferComponentDeviceMinimumMask = 0x03
  1597. };
  1598.  
  1599.  
  1600. enum {
  1601.     gxOmitTransferComponentModeShift = 7,
  1602.     gxOmitTransferComponentFlagsShift = 6,
  1603.     gxOmitTransferComponentSourceMinimumShift = 4,
  1604.     gxOmitTransferComponentSourceMaximumShift = 2,
  1605.     gxOmitTransferComponentDeviceMinimumShift = 0
  1606. };
  1607.  
  1608.  
  1609. enum {
  1610.     gxOmitTransferComponentDeviceMaximumMask = 0xC0,
  1611.     gxOmitTransferComponentClampMinimumMask = 0x30,
  1612.     gxOmitTransferComponentClampMaximumMask = 0x0C,
  1613.     gxOmitTransferComponentOperandMask = 0x03
  1614. };
  1615.  
  1616.  
  1617. enum {
  1618.     gxOmitTransferComponentDeviceMaximumShift = 6,
  1619.     gxOmitTransferComponentClampMinimumShift = 4,
  1620.     gxOmitTransferComponentClampMaximumShift = 2,
  1621.     gxOmitTransferComponentOperandShift = 0
  1622. };
  1623.  
  1624.  
  1625. enum {
  1626.     gxStyleAttributesOpcode        = 0,
  1627.     gxStyleTagOpcode            = 1,
  1628.     gxStyleCurveErrorOpcode        = 2,
  1629.     gxStylePenOpcode            = 3,
  1630.     gxStyleJoinOpcode            = 4,
  1631.     gxStyleDashOpcode            = 5,
  1632.     gxStyleCapsOpcode            = 6,
  1633.     gxStylePatternOpcode        = 7,
  1634.     gxStyleTextAttributesOpcode    = 8,
  1635.     gxStyleTextSizeOpcode        = 9,
  1636.     gxStyleFontOpcode            = 10,
  1637.     gxStyleTextFaceOpcode        = 11,
  1638.     gxStylePlatformOpcode        = 12,
  1639.     gxStyleFontVariationsOpcode    = 13,
  1640.     gxStyleRunControlsOpcode    = 14,
  1641.     gxStyleRunPriorityJustOverrideOpcode = 15,
  1642.     gxStyleRunGlyphJustOverridesOpcode = 16,
  1643.     gxStyleRunGlyphSubstitutionsOpcode = 17,
  1644.     gxStyleRunFeaturesOpcode    = 18,
  1645.     gxStyleRunKerningAdjustmentsOpcode = 19,
  1646.     gxStyleJustificationOpcode    = 20
  1647. };
  1648.  
  1649.  
  1650. enum {
  1651.     gxOmitDashAttributesMask    = 0xC0,
  1652.     gxOmitDashShapeMask            = 0x30,
  1653.     gxOmitDashAdvanceMask        = 0x0C,
  1654.     gxOmitDashPhaseMask            = 0x03
  1655. };
  1656.  
  1657.  
  1658. enum {
  1659.     gxOmitDashAttributesShift    = 6,
  1660.     gxOmitDashShapeShift        = 4,
  1661.     gxOmitDashAdvanceShift        = 2,
  1662.     gxOmitDashPhaseShift        = 0
  1663. };
  1664.  
  1665.  
  1666. enum {
  1667.     gxOmitDashScaleMask            = 0xC0
  1668. };
  1669.  
  1670.  
  1671. enum {
  1672.     gxOmitDashScaleShift        = 6
  1673. };
  1674.  
  1675.  
  1676. enum {
  1677.     gxOmitPatternAttributesMask    = 0xC0,
  1678.     gxOmitPatternShapeMask        = 0x30,
  1679.     gxOmitPatternUXMask            = 0x0C,
  1680.     gxOmitPatternUYMask            = 0x03
  1681. };
  1682.  
  1683.  
  1684. enum {
  1685.     gxOmitPatternAttributesShift = 6,
  1686.     gxOmitPatternShapeShift        = 4,
  1687.     gxOmitPatternUXShift        = 2,
  1688.     gxOmitPatternUYShift        = 0
  1689. };
  1690.  
  1691.  
  1692. enum {
  1693.     gxOmitPatternVXMask            = 0xC0,
  1694.     gxOmitPatternVYMask            = 0x30
  1695. };
  1696.  
  1697.  
  1698. enum {
  1699.     gxOmitPatternVXShift        = 6,
  1700.     gxOmitPatternVYShift        = 4
  1701. };
  1702.  
  1703.  
  1704. enum {
  1705.     gxOmitJoinAttributesMask    = 0xC0,
  1706.     gxOmitJoinShapeMask            = 0x30,
  1707.     gxOmitJoinMiterMask            = 0x0C
  1708. };
  1709.  
  1710.  
  1711. enum {
  1712.     gxOmitJoinAttributesShift    = 6,
  1713.     gxOmitJoinShapeShift        = 4,
  1714.     gxOmitJoinMiterShift        = 2
  1715. };
  1716.  
  1717.  
  1718. enum {
  1719.     gxOmitCapAttributesMask        = 0xC0,
  1720.     gxOmitCapStartShapeMask        = 0x30,
  1721.     gxOmitCapEndShapeMask        = 0x0C
  1722. };
  1723.  
  1724.  
  1725. enum {
  1726.     gxOmitCapAttributesShift    = 6,
  1727.     gxOmitCapStartShapeShift    = 4,
  1728.     gxOmitCapEndShapeShift        = 2
  1729. };
  1730.  
  1731.  
  1732. enum {
  1733.     gxOmitFaceLayersMask        = 0xC0,
  1734.     gxOmitFaceMappingMask        = 0x30
  1735. };
  1736.  
  1737.  
  1738. enum {
  1739.     gxOmitFaceLayersShift        = 6,
  1740.     gxOmitFaceMappingShift        = 4
  1741. };
  1742.  
  1743.  
  1744. enum {
  1745.     gxOmitFaceLayerFillMask        = 0xC0,
  1746.     gxOmitFaceLayerFlagsMask    = 0x30,
  1747.     gxOmitFaceLayerStyleMask    = 0x0C,
  1748.     gxOmitFaceLayerTransformMask = 0x03
  1749. };
  1750.  
  1751.  
  1752. enum {
  1753.     gxOmitFaceLayerFillShift    = 6,
  1754.     gxOmitFaceLayerFlagsShift    = 4,
  1755.     gxOmitFaceLayerStyleShift    = 2,
  1756.     gxOmitFaceLayerTransformShift = 0
  1757. };
  1758.  
  1759.  
  1760. enum {
  1761.     gxOmitFaceLayerBoldXMask    = 0xC0,
  1762.     gxOmitFaceLayerBoldYMask    = 0x30
  1763. };
  1764.  
  1765.  
  1766. enum {
  1767.     gxOmitFaceLayerBoldXShift    = 6,
  1768.     gxOmitFaceLayerBoldYShift    = 4
  1769. };
  1770.  
  1771.  
  1772. enum {
  1773.     gxColorSetReservedOpcode    = 0,
  1774.     gxColorSetTagOpcode            = 1
  1775. };
  1776.  
  1777.  
  1778. enum {
  1779.     gxColorProfileReservedOpcode = 0,
  1780.     gxColorProfileTagOpcode        = 1
  1781. };
  1782.  
  1783.  
  1784. enum {
  1785.     gxTransformReservedOpcode    = 0,
  1786.     gxTransformTagOpcode        = 1,
  1787.     gxTransformClipOpcode        = 2,
  1788.     gxTransformMappingOpcode    = 3,
  1789.     gxTransformPartMaskOpcode    = 4,
  1790.     gxTransformToleranceOpcode    = 5
  1791. };
  1792.  
  1793.  
  1794. enum {
  1795.     gxTypeOpcode                = 0,
  1796.     gxSizeOpcode                = 1
  1797. };
  1798.  
  1799. /* used by currentOperand when currentOperation is gxNextOpcode */
  1800. /*    format of top byte:
  1801. xx yyyyyy    xx == 0x00, 0x40, 0x80, 0xC0: defines graphics operation (see gxGraphicsOperationOpcode)
  1802.             yyyyyy == size of operation in bytes
  1803.             if (yyyyyy == 0), byte size follows. If byte following == 0, word size follows; if == 0, long follows
  1804.             word and long, if present, are specified in high-endian order (first byte is largest magnitude)
  1805.             
  1806. format of byte following size specifiers, if any:
  1807. xx yyyyyy    xx == 0x00, 0x40, 0x80, 0xC0: defines compression level (0 == none, 0xC0 == most)
  1808.             exact method of compression is defined by type of data
  1809.             yyyyyy == data type selector (0 to 63): see gxGraphicsNewOpcode, __DataOpcode
  1810. */
  1811.  
  1812. enum {
  1813.     gxOpcodeShift                = 6,
  1814.     gxObjectSizeMask            = 0x3F,
  1815.     gxCompressionShift            = 6,
  1816.     gxObjectTypeMask            = 0x3F,
  1817.     gxBitImageOpcodeMask        = 0xC0,
  1818.     gxBitImageCountMask            = 0x3F,
  1819.     gxBitImageOpcodeShift        = 6
  1820. };
  1821.  
  1822.  
  1823. enum {
  1824.     gxNoCompression                = 0,
  1825.     gxWordCompression            = 1,
  1826.     gxByteCompression            = 2,
  1827.     gxOmitCompression            = 3,
  1828.     gxCompressionMask            = 0x03
  1829. };
  1830.  
  1831. /*    the following structures define how primitives without a public geometry
  1832.     are stored (their format mirrors that of the New call to create them)    */
  1833.  
  1834. struct gxFlatFontName {
  1835.     unsigned char                     name;                        /* gxFontName */
  1836.     unsigned char                     platform;                    /* gxFontPlatform */
  1837.     unsigned char                     script;                        /* gxFontScript */
  1838.     unsigned char                     language;                    /* gxFontLanguage */
  1839.     short                             length;                        /* byte length */
  1840. };
  1841. typedef struct gxFlatFontName            gxFlatFontName;
  1842.  
  1843. enum {
  1844.     gxFlatFontListItemTag        = FOUR_CHAR_CODE('flst')
  1845. };
  1846.  
  1847.  
  1848. struct gxFlatFontListItem {
  1849.     gxFont                             fontID;                        /*** if we get rid of this, remove #include "font types.h", above */
  1850.     unsigned char                     name;                        /* gxFontName */
  1851.     unsigned char                     platform;                    /* gxFontPlatform */
  1852.     unsigned char                     script;                        /* gxFontScript */
  1853.     unsigned char                     language;                    /* gxFontLanguage */
  1854.     short                             length;                        /* byte length of the name that follows */
  1855.     unsigned short                     glyphCount;                    /* CountFontGlyphs or 0 if gxFontGlyphsFlatten is false */
  1856.     unsigned short                     axisCount;                    /* CountFontVariations or 0 if gxFontVariationsFlatten is false */
  1857.     unsigned short                     variationCount;                /* number of bitsVariationPairs that follow the (optional) glyphBits */
  1858. };
  1859. typedef struct gxFlatFontListItem        gxFlatFontListItem;
  1860.  
  1861. struct gxFlatFontList {
  1862.     long                             count;
  1863.     gxFlatFontListItem                 items[1];
  1864. };
  1865. typedef struct gxFlatFontList            gxFlatFontList;
  1866.  
  1867. struct gxFlattenHeader {
  1868.     Fixed                             version;
  1869.     unsigned char                     flatFlags;
  1870.     SInt8                             padding;
  1871. };
  1872. typedef struct gxFlattenHeader            gxFlattenHeader;
  1873.  
  1874. enum {
  1875.     gxOmitPictureShapeMask        = 0xC0,
  1876.     gxOmitOverrideStyleMask        = 0x30,
  1877.     gxOmitOverrideInkMask        = 0x0C,
  1878.     gxOmitOverrideTransformMask    = 0x03
  1879. };
  1880.  
  1881.  
  1882. enum {
  1883.     gxOmitPictureShapeShift        = 0x06,
  1884.     gxOmitOverrideStyleShift    = 0x04,
  1885.     gxOmitOverrideInkShift        = 0x02,
  1886.     gxOmitOverrideTransformShift = 0x00
  1887. };
  1888.  
  1889.  
  1890. enum {
  1891.     gxPostScriptTag                = FOUR_CHAR_CODE('post'),
  1892.     gxPostControlTag            = FOUR_CHAR_CODE('psct')
  1893. };
  1894.  
  1895.  
  1896. enum {
  1897.     gxNoSave                    = 1,                            /* don't do save-restore around PS data */
  1898.     gxPSContinueNext            = 2                                /* next shape is continuation of this shape's PS -- only obeyed if gxNoSave is true */
  1899. };
  1900.  
  1901.  
  1902. struct gxPostControl {
  1903.     long                             flags;                        /* PostScript state flags */
  1904. };
  1905. typedef struct gxPostControl            gxPostControl;
  1906.  
  1907. enum {
  1908.     gxDashSynonymTag            = FOUR_CHAR_CODE('sdsh')
  1909. };
  1910.  
  1911.  
  1912. struct gxDashSynonym {
  1913.     long                             size;                        /* number of elements in array */
  1914.     Fixed                             dashLength[1];                /* Array of dash lengths */
  1915. };
  1916. typedef struct gxDashSynonym            gxDashSynonym;
  1917.  
  1918. enum {
  1919.     gxLineCapSynonymTag            = FOUR_CHAR_CODE('lcap')
  1920. };
  1921.  
  1922.  
  1923. enum {
  1924.     gxButtCap                    = 0,
  1925.     gxRoundCap                    = 1,
  1926.     gxSquareCap                    = 2,
  1927.     gxTriangleCap                = 3
  1928. };
  1929.  
  1930. /* gxLine cap type */
  1931.  
  1932. typedef long                             gxLineCapSynonym;
  1933.  
  1934. enum {
  1935.     gxCubicSynonymTag            = FOUR_CHAR_CODE('cubx')
  1936. };
  1937.  
  1938.  
  1939. enum {
  1940.     gxIgnoreFlag                = 0x0000,                        /* Ignore this word, get next one */
  1941.     gxLineToFlag                = 0x0001,                        /* Draw a gxLine to gxPoint following this flag */
  1942.     gxCurveToFlag                = 0x0002,                        /* Draw a gxCurve through the 3 points following this flag */
  1943.     gxMoveToFlag                = 0x0003,                        /* Start a new contour at the gxPoint following this flag */
  1944.     gxClosePathFlag                = 0x0004                        /* Close the contour */
  1945. };
  1946.  
  1947. typedef long                             gxCubicSynonym;
  1948.  
  1949. enum {
  1950.     gxCubicInstructionMask        = 0x000F                        /* low four bits are gxPoint instructions */
  1951. };
  1952.  
  1953. /* Low four bits are instruction (moveto, lineto, curveto, closepath) */
  1954. typedef short                             gxCubicSynonymFlags;
  1955.  
  1956. enum {
  1957.     gxPatternSynonymTag            = FOUR_CHAR_CODE('ptrn')
  1958. };
  1959.  
  1960.  
  1961. enum {
  1962.     gxHatch                        = 0,
  1963.     gxCrossHatch                = 1
  1964. };
  1965.  
  1966.  
  1967. struct gxPatternSynonym {
  1968.     long                             patternType;                /* one of the gxPatterns: gxHatch or gxCrossHatch */
  1969.     Fixed                             angle;                        /* angle at which pattern is drawn */
  1970.     Fixed                             spacing;                    /* distance between two parallel pattern lines */
  1971.     Fixed                             thickness;                    /* thickness of the pattern */
  1972.     gxPoint                         anchorPoint;                /* gxPoint with with respect to which pattern position is calculated */
  1973. };
  1974. typedef struct gxPatternSynonym            gxPatternSynonym;
  1975.  
  1976. enum {
  1977.     gxURLTag                    = FOUR_CHAR_CODE('urlt')
  1978. };
  1979.  
  1980.  
  1981. #if PRAGMA_STRUCT_ALIGN
  1982.     #pragma options align=reset
  1983. #elif PRAGMA_STRUCT_PACKPUSH
  1984.     #pragma pack(pop)
  1985. #elif PRAGMA_STRUCT_PACK
  1986.     #pragma pack()
  1987. #endif
  1988.  
  1989. #ifdef PRAGMA_IMPORT_OFF
  1990. #pragma import off
  1991. #elif PRAGMA_IMPORT
  1992. #pragma import reset
  1993. #endif
  1994.  
  1995. #ifdef __cplusplus
  1996. }
  1997. #endif
  1998.  
  1999. #endif /* __GXTYPES__ */
  2000.  
  2001.